using System.Collections.Generic;
using UnityEngine;

namespace CGF
{
    public class GameLaunch : ComponentBase, IAwake
    {
        public static GameLaunch Instance;
        
        public async void Awake()
        {
            //框架准备完成，开始进入项目流程
            Instance = this;

            CommAssets.Create(RootComponent.instance, null);
            
            AddComponent<MusicPlayer>();
            VideoPluginMsgListener.Init();
            
            //尝试从缓存登录
            if (!await UserInfo.IsLoggedIn())
            {
                LoginUI.Open();
            }
            else
            {
                GameUI.Open();
            }
        }
    }
}